package com.micro.common;

/**
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020/8/3
 */
public enum MicroResponseCode {

    SUCCESS("200","成功"),
    FAIL("500","系统异常,请联系管理员"),
    PARAMS_HAS_EMPTY("503","参数校验失败,存在空参数"),
    PARAMS_VALIDATA_FAIL("504","参数校验失败"),
    REPEAT_SUBMIT("508","重复请求,请稍后再试"),

    /********************** JWT  401开头 ************************/
    JWT_TOKEN_EXPIRED("401001","token超时，请检查 token 的有效期"),
    JWT_SIGNATURE_ERROR("401002","不合法的token，请认真比对 token 的签名"),
    JWT_ILLEGAL_ARGUMENT("401003","缺少token参数"),
    JWT_GEN_TOKEN_FAIL("401004","生成token失败"),
    JWT_PARSER_TOKEN_FAIL("401005","解析token失败"),
    JWT_APPID_SECRET_INVALID("401006","获取 access_token 时 AppSecret 错误，或者 AppId 无效!"),
    JWT_APPID_ENABLED("401007","AppId 已经被禁用！请联系管理员"),
    JWT_CLIENT_FORBIDDEN("401008","客户端已被禁用！请联系管理员"),
    CLIENT_NOT_FOUDN("401009","客户端不存在"),
    AUTH_TOKEN_INVALIDATION("401201","长期未登陆,请重新登录"),
    AUTH_ACCOUNT_LANDING_ON_OTHER_DEVICES("401202","账户已在其他设备登陆,请重新登陆"),
    PERMISSION_DENIED("401301","没有权限,请联系管理员"),
    REQUEST_ORIGIN_ERROR("401302","请求来源不合法"),

    /********************** 文件上传 402 ************************/
    UPLOAD_FILES_CANNOT_BE_EMPTY("402001","上传文件不能为空"),
    UPLOAD_FILE_TYPE_DOES_NOT_MATCH("402002","上传文件类型不符合要求"),
    FILE_CANNOT_BE_GREATER_THAN_MAXIMUM("402003","上传文件不能大于指定最大值"),
    FILE_CANNOT_BE_LESS_THAN_MINIMUM("402004","上传文件不能小于指定最小值"),
    UPLOAD_QINIU_FAILED("402005","上传文件失败，请核对七牛配置信息"),


    /********************** 优惠券 ************************/
    EXIST_SAME_NAME_TEMPLATE("401401","存在相同名称的优惠券模版"),


    /** 系统相关**/
    MENU_HAS_EXIST("400117","菜单已存在"),
    ELEMENT_HAS_EXIST("400117","按钮已存在"),
    /** 用户相关 **/
    USER_NOT_EXIST("400108","用户不存在"),
    USER_HAS_LOCKED("400109","用户被锁定,请稍后再试"),
    USER_HAS_FORBIDDEN("400110","账户被禁用,请联系管理员"),
    USER_HAS_WRONG_WITH_ACCOUNT_OR_PASSWORD("400111","用户名或密码错误"),
    LOGIN_NAME_HAS_EXIST("400112","用户名已存在"),
    EMAIL_HAS_EXIST("400113","邮箱已存在"),
    PHONE_HAS_EXIST("400114","手机号已存在"),
    LOGIN_FAIL("400130","登录失败，请重新登录"),
    ROLE_HAS_DISTRIBUTION_PERMISSION("400131","角色已分配权限,不允许删除"),
    ROLE_HAS_DISTRIBUTION_USER("400131","角色已分配用户,不允许删除"),
    MENU_HAS_DISTRIBUTION_NOT_ALLOW_DELETE("400132","菜单已分配,不允许删除"),
    MENU_HAS_DISTRIBUTION_NOT_ALLOW_CLOSE("400132","菜单已分配,不允许关闭"),
    ELEMENT_HAS_DISTRIBUTION_NOT_ALLOW_DELETE("400132","元素已分配,不允许删除"),
    MENU_HAS_CHILD("400133","存在菜单,不允许删除"),
    ROLE_HAS_BIND_USER("400131","角色已分配用户,不允许禁用"),
    ROLE_HAS_EXIST("400115","角色已存在"),
    NOTIFICATION_TYPE_DOES_NOT_EXIST("400113","通知类别不存在"),
    SELECT_AT_LEAST_ONE_ROLE("400114","至少选择一种角色"),

    /** 不合法校验 **/
    LOGIN_ORIGIN_ERROR("400114","登录来源不合法"),
    CUSTOMER_TYPE_ERROR("400115","用户类别不合法"),
    ACCOUNT_TYPE_ERROR("400116","账户类别不合法"),
    PASS_WORD_VALID_ERROR("400117","两次密码不一致"),
    COUPON_COUNT_VALID_ERROR("400118","优惠券校验失败"),
    COUPON_TEMPLATE_NOT_EXIST("400119","优惠券模版不存在"),
    EXCEED_TEMPLATE_ASSIGN_LIMITATIO("400120","超出模板分配限制"),
    CAN_NOT_ACQUIRE_COUPON_CODE("400121","无法获取优惠券代码"),
    CATEGORY_HAS_CHILD_NOT_ALLOW_DELETE("400123","存在子分类,不允许删除"),
    CATEGORY_HAS_CHILD_NOT_ALLOW_CLOSE("400123","存在子分类,不允许关闭"),
    PREFECTURE_HAS_EXIST("400122","专区已存在"),
    HAS_IN_PROGRESS_SECKILL_NOT_ALLOW_DELETE("400123","存在进行中的秒杀活动不允许删除"),
    HAS_IN_PROGRESS_SECKILL_NOT_ALLOW_CLOSE("400124","存在进行中的秒杀活动不允许修改"),
    START_TIME_MUST_GREATER_THAN_NOW_TIME("400125","秒杀开始时间应大于当前时间"),
    GOODS_TEMPLATE_HAS_EXIST("400126","模版已存在"),
    GOODS_PARAMS_HAS_EXIST("400130","参数已存在"),
    GOODS_SPEC_HAS_EXIST("400131","规格名已存在"),
    TEMPLATE_HAS_DISTRIBUTION_CATEGORY("400127","模版已分配类目,不允许删除"),
    TEMPLATE_HAS_DISTRIBUTION_PARAMETER("400128","模版已绑定参数,不允许删除"),
    TEMPLATE_HAS_DISTRIBUTION_SPEC("400129","模版已绑定规格,不允许删除"),
    HAS_IN_PROGRESS_ADVERT_NOT_ALLOW_DELETE("400130","广告正在进行中活动不允许删除"),
    GOODS_BRAND_CATEGORY_HAS_EXIST("400131","分类已绑定,请重新选择"),
    DEPT_HAS_CHILD_NOT_ALLOW_DELETE("400132","存在子部门,不允许删除"),
    DEPT_HAS_DIND_ROLE_NOT_ALLOW_DELETE("400131","部门已分配角色,不允许删除"),
    GOODS_ON_SALE_NOT_ALLOW_DELETE("400132","在售商品,不允许删除"),
    MOUDLE_HAS_DISTRIBUTION_MESSAGE_NOT_ALLOW_DELETE("400133","模块已分配消息,不允许删除"),
    MESSAGE_MODUAL_NAME_HAS_EXIST("400134","模块名称已存在"),
    MESSAGE_MODUAL_CODE_HAS_EXIST("400135","模块编号已存在"),
    CPUPON_TEMPLATE_NAME_HAS_EXIST("400136","优惠券模版已存在"),
    NOT_SUPPORT_FOR_MORE_TEMPLATE_CATEGORY("400137","不支持多模板类别"),
    NOT_SUPPORT_FOR_OTHER_TEMPLATE_CATEGORY("400138","不支持其他模板类别");;

    /**
     * <h2>返回码</h2>
     */
    private String responseCode;

    /**
     * <h2>返回消息</h2>
     */
    private String responseMessage;

    /**
     * <h2>全局返回code码 有参构造类</h2>
     * @param responseCode            返回编号
     * @param responseMessage         返回消息
     */
    private MicroResponseCode(String responseCode, String responseMessage) {
        this.responseCode = responseCode;
        this.responseMessage = responseMessage;
    }


    public String getResponseCode() {
        return responseCode;
    }

    public void setResponseCode(String responseCode) {
        this.responseCode = responseCode;
    }

    public String getResponseMessage() {
        return responseMessage;
    }

    public void setResponseMessage(String responseMessage) {
        this.responseMessage = responseMessage;
    }

}
